<div class="layui-fluid z-main">
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            {foreach $infomod as $key=>$value}
            <li {if $key==0}class="layui-this" {/if}>{$value}</li>
            {/foreach}
        </ul>
        <div class="layui-tab-content">
            {foreach $infomod as $key=>$value}
            <div class="layui-tab-item {if $key==0}layui-show{/if}">
                <form class="layui-form layui-form-pane z-form-130" method="post">
                    <input type="hidden" name="pagemod" value="{$key}">
                    {foreach $fields as $item}
                    {if in_array($key,explode(',',$item['mods']))}
                    {if $item['type']=='textarea'}
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">{if $item['required']}<span class="rq">*</span>{/if}{$item['title']}</label>
                        <div class="layui-input-block">
                            <textarea name="field{$item['field_id']}" class="layui-textarea" placeholder="{$item['tips']}" {if $item['required']} required="" lay-verify="required"{/if}>{$user['field'.$item['field_id']]}</textarea>
                        </div>
                    </div>
                    {else}
                    <div class="layui-form-item">
                        <label class="layui-form-label">{if $item['required']}<span class="rq">*</span>{/if}{$item['title']}</label>
                        <div class="layui-input-inline">
                            {if in_array($item['type'],["text","number","password"])}
                            <input name="field{$item['field_id']}" autocomplete="off" class="layui-input" value="{$user['field'.$item['field_id']]}" type="{$item['type']}"{if $item['required']} required="" lay-verify="required"{/if}>
                            {elseif $item['type']=='date'}
                            <input name="field{$item['field_id']}" id="field{$item['field_id']}" autocomplete="off" class="layui-input z-date" value="{$user['field'.$item['field_id']]}" type="text"{if $item['required']} required="" lay-verify="required"{/if}>
                            {elseif $item['type']=='switch'}
                            <input type="checkbox" name="field{$item['field_id']}" lay-skin="switch" value="1" lay-text="{:str_replace(',','|',$item['setting'])}" {if $user['field'.$item['field_id']]}checked=""{/if}>
                            {elseif in_array($item['type'],['radio','checkbox','select'])}
                            {php}$vals = explode(',',$item['setting']);{/php}
                            {if $item['type']=='select'}
                            <select name="field{$item['field_id']}" {if $item['required']} required="" lay-verify="required"{/if}>
                                <option></option>
                                {foreach $vals as $val}
                                {php}$i = explode('|',$val);{/php}
                                <option value="{$i[0]}" {if $i[0]==$user['field'.$item['field_id']]}selected=""{/if}>{$i[1]|default=$i[0]}</option>
                            {/foreach}
                            </select>
                            {elseif $item['type']=='radio'}
                            {foreach $vals as $val}
                            {php}$i = explode('|',$val);{/php}
                            <input type="radio" name="field{$item['field_id']}" value="{$i[0]}" title="{$i[1]|default=$i[0]}" {if $i[0]==$user['field'.$item['field_id']]}checked=""{/if}>
                            {/foreach}
                            {elseif $item['type']=='checkbox'}
                            {php}$values = explode(',',$user['field'.$item['field_id']]);{/php}
                            {foreach $vals as $val}
                            {php}$i = explode('|',$val);{/php}
                            <input type="checkbox" name="field{$item['field_id']}[]" value="{$i[0]}" title="{$i[1]|default=$i[0]}" {if in_array($i[0],$values)}checked=""{/if}>
                            {/foreach}
                            {/if}
                            {/if}
                        </div>
                        {if $item['tips']}
                        <div class="layui-form-mid layui-word-aux">{$item['tips']}</div>
                        {/if}
                    </div>
                    {/if}
                    {/if}
                    {/foreach}
                    <button lay-submit lay-filter="*" class="layui-btn">保存</button>
                </form>
            </div>
            {/foreach}
        </div>
    </div>
</div>